package GM.diagram.part;

import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;

import GM.GMPackage;
import GM.GoalDiagram;
import GM.diagram.edit.parts.ActionActionTypeEditPart;
import GM.diagram.edit.parts.ActionEditPart;
import GM.diagram.edit.parts.AdGoalConditionAdGoalCompartmentEditPart;
import GM.diagram.edit.parts.AdGoalEditPart;
import GM.diagram.edit.parts.AdGoalNamePriorityEditPart;
import GM.diagram.edit.parts.AdGoalTriggerAdGoalCompartmentEditPart;
import GM.diagram.edit.parts.AgentEditPart;
import GM.diagram.edit.parts.AgentNameEditPart;
import GM.diagram.edit.parts.Attribute2EditPart;
import GM.diagram.edit.parts.AttributeEditPart;
import GM.diagram.edit.parts.AttributeMultiplicityNameType2EditPart;
import GM.diagram.edit.parts.AttributeMultiplicityNameTypeEditPart;
import GM.diagram.edit.parts.ContributionLinkEditPart;
import GM.diagram.edit.parts.ContributionLinkWeightEditPart;
import GM.diagram.edit.parts.Definition2EditPart;
import GM.diagram.edit.parts.Definition3EditPart;
import GM.diagram.edit.parts.Definition4EditPart;
import GM.diagram.edit.parts.Definition5EditPart;
import GM.diagram.edit.parts.Definition6EditPart;
import GM.diagram.edit.parts.Definition7EditPart;
import GM.diagram.edit.parts.Definition8EditPart;
import GM.diagram.edit.parts.DefinitionDef2EditPart;
import GM.diagram.edit.parts.DefinitionDef3EditPart;
import GM.diagram.edit.parts.DefinitionDef4EditPart;
import GM.diagram.edit.parts.DefinitionDef5EditPart;
import GM.diagram.edit.parts.DefinitionDef6EditPart;
import GM.diagram.edit.parts.DefinitionDef7EditPart;
import GM.diagram.edit.parts.DefinitionDef8EditPart;
import GM.diagram.edit.parts.DefinitionDefEditPart;
import GM.diagram.edit.parts.DefinitionEditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment2EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment3EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment4EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment5EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment6EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment7EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment8EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartmentEditPart;
import GM.diagram.edit.parts.EntityAttributeCompartmentEditPart;
import GM.diagram.edit.parts.EntityEditPart;
import GM.diagram.edit.parts.EntityNameEditPart;
import GM.diagram.edit.parts.EntityRefCompartEditPart;
import GM.diagram.edit.parts.EntityStateCompartmentEditPart;
import GM.diagram.edit.parts.EventAttrEntityCompartEditPart;
import GM.diagram.edit.parts.EventEditPart;
import GM.diagram.edit.parts.EventNameEditPart;
import GM.diagram.edit.parts.EventParamCompartsEditPart;
import GM.diagram.edit.parts.GoalDiagramEditPart;
import GM.diagram.edit.parts.GoalEditPart;
import GM.diagram.edit.parts.GoalLtlCompartmentEditPart;
import GM.diagram.edit.parts.GoalNameEditPart;
import GM.diagram.edit.parts.Mapping2EditPart;
import GM.diagram.edit.parts.Mapping3EditPart;
import GM.diagram.edit.parts.Mapping4EditPart;
import GM.diagram.edit.parts.Mapping5EditPart;
import GM.diagram.edit.parts.Mapping6EditPart;
import GM.diagram.edit.parts.Mapping7EditPart;
import GM.diagram.edit.parts.Mapping8EditPart;
import GM.diagram.edit.parts.MappingEditPart;
import GM.diagram.edit.parts.MappingName2EditPart;
import GM.diagram.edit.parts.MappingName3EditPart;
import GM.diagram.edit.parts.MappingName4EditPart;
import GM.diagram.edit.parts.MappingName5EditPart;
import GM.diagram.edit.parts.MappingName6EditPart;
import GM.diagram.edit.parts.MappingName7EditPart;
import GM.diagram.edit.parts.MappingName8EditPart;
import GM.diagram.edit.parts.MappingNameEditPart;
import GM.diagram.edit.parts.OperationDompostCompartmentEditPart;
import GM.diagram.edit.parts.OperationDompreCompartmentEditPart;
import GM.diagram.edit.parts.OperationEditPart;
import GM.diagram.edit.parts.OperationNameEditPart;
import GM.diagram.edit.parts.OperationReqpostCompartmentEditPart;
import GM.diagram.edit.parts.OperationReqpreCompartmentEditPart;
import GM.diagram.edit.parts.OperationTrigpreCompartmentEditPart;
import GM.diagram.edit.parts.Reference2EditPart;
import GM.diagram.edit.parts.ReferenceEditPart;
import GM.diagram.edit.parts.ReferenceMultiplicityName2EditPart;
import GM.diagram.edit.parts.ReferenceMultiplicityNameEditPart;
import GM.diagram.edit.parts.RefinementLinkEditPart;
import GM.diagram.edit.parts.RefinementLinkTypeEditPart;
import GM.diagram.edit.parts.StateEditPart;
import GM.diagram.edit.parts.StateNameEditPart;

/**
 * This registry is used to determine which type of visual object should be
 * created for the corresponding Diagram, Node, ChildNode or Link represented
 * by a domain model object.
 * 
 * @generated
 */
public class GMVisualIDRegistry {

	/**
	 * @generated
	 */
	private static final String DEBUG_KEY = "project.goal.diagram/debug/visualID"; //$NON-NLS-1$

	/**
	 * @generated
	 */
	public static int getVisualID(View view) {
		if (view instanceof Diagram) {
			if (GoalDiagramEditPart.MODEL_ID.equals(view.getType())) {
				return GoalDiagramEditPart.VISUAL_ID;
			} else {
				return -1;
			}
		}
		return GM.diagram.part.GMVisualIDRegistry.getVisualID(view.getType());
	}

	/**
	 * @generated
	 */
	public static String getModelID(View view) {
		View diagram = view.getDiagram();
		while (view != diagram) {
			EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
			if (annotation != null) {
				return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$
			}
			view = (View) view.eContainer();
		}
		return diagram != null ? diagram.getType() : null;
	}

	/**
	 * @generated
	 */
	public static int getVisualID(String type) {
		try {
			return Integer.parseInt(type);
		} catch (NumberFormatException e) {
			if (Boolean.TRUE.toString().equalsIgnoreCase(
					Platform.getDebugOption(DEBUG_KEY))) {
				GMDiagramEditorPlugin.getInstance().logError(
						"Unable to parse view type as a visualID number: "
								+ type);
			}
		}
		return -1;
	}

	/**
	 * @generated
	 */
	public static String getType(int visualID) {
		return Integer.toString(visualID);
	}

	/**
	 * @generated
	 */
	public static int getDiagramVisualID(EObject domainElement) {
		if (domainElement == null) {
			return -1;
		}
		if (GMPackage.eINSTANCE.getGoalDiagram().isSuperTypeOf(
				domainElement.eClass())
				&& isDiagram((GoalDiagram) domainElement)) {
			return GoalDiagramEditPart.VISUAL_ID;
		}
		return -1;
	}

	/**
	 * @generated
	 */
	public static int getNodeVisualID(View containerView, EObject domainElement) {
		if (domainElement == null) {
			return -1;
		}
		String containerModelID = GM.diagram.part.GMVisualIDRegistry
				.getModelID(containerView);
		if (!GoalDiagramEditPart.MODEL_ID.equals(containerModelID)) {
			return -1;
		}
		int containerVisualID;
		if (GoalDiagramEditPart.MODEL_ID.equals(containerModelID)) {
			containerVisualID = GM.diagram.part.GMVisualIDRegistry
					.getVisualID(containerView);
		} else {
			if (containerView instanceof Diagram) {
				containerVisualID = GoalDiagramEditPart.VISUAL_ID;
			} else {
				return -1;
			}
		}
		switch (containerVisualID) {
		case GoalDiagramEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getGoal().isSuperTypeOf(
					domainElement.eClass())) {
				return GoalEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getAdGoal().isSuperTypeOf(
					domainElement.eClass())) {
				return AdGoalEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getOperation().isSuperTypeOf(
					domainElement.eClass())) {
				return OperationEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getEntity().isSuperTypeOf(
					domainElement.eClass())) {
				return EntityEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getEvent().isSuperTypeOf(
					domainElement.eClass())) {
				return EventEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getAction().isSuperTypeOf(
					domainElement.eClass())) {
				return ActionEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getAgent().isSuperTypeOf(
					domainElement.eClass())) {
				return AgentEditPart.VISUAL_ID;
			}
			if (GMPackage.eINSTANCE.getRefinementLink().isSuperTypeOf(
					domainElement.eClass())) {
				return RefinementLinkEditPart.VISUAL_ID;
			}
			break;
		case GoalLtlCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return DefinitionEditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return MappingEditPart.VISUAL_ID;
			}
			break;
		case AdGoalTriggerAdGoalCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition3EditPart.VISUAL_ID;
			}
			break;
		case AdGoalConditionAdGoalCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition2EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment3EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping2EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment4EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping3EditPart.VISUAL_ID;
			}
			break;
		case OperationDompostCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition4EditPart.VISUAL_ID;
			}
			break;
		case OperationDompreCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition5EditPart.VISUAL_ID;
			}
			break;
		case OperationReqpostCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition8EditPart.VISUAL_ID;
			}
			break;
		case OperationReqpreCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition6EditPart.VISUAL_ID;
			}
			break;
		case OperationTrigpreCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getDefinition().isSuperTypeOf(
					domainElement.eClass())) {
				return Definition7EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment2EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping4EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment5EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping5EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment6EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping6EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment7EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping7EditPart.VISUAL_ID;
			}
			break;
		case DefinitionMappingCompartment8EditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getMapping().isSuperTypeOf(
					domainElement.eClass())) {
				return Mapping8EditPart.VISUAL_ID;
			}
			break;
		case EntityStateCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getState().isSuperTypeOf(
					domainElement.eClass())) {
				return StateEditPart.VISUAL_ID;
			}
			break;
		case EntityAttributeCompartmentEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getAttribute().isSuperTypeOf(
					domainElement.eClass())) {
				return AttributeEditPart.VISUAL_ID;
			}
			break;
		case EntityRefCompartEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getReference().isSuperTypeOf(
					domainElement.eClass())) {
				return ReferenceEditPart.VISUAL_ID;
			}
			break;
		case EventAttrEntityCompartEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getAttribute().isSuperTypeOf(
					domainElement.eClass())) {
				return Attribute2EditPart.VISUAL_ID;
			}
			break;
		case EventParamCompartsEditPart.VISUAL_ID:
			if (GMPackage.eINSTANCE.getReference().isSuperTypeOf(
					domainElement.eClass())) {
				return Reference2EditPart.VISUAL_ID;
			}
			break;
		}
		return -1;
	}

	/**
	 * @generated
	 */
	public static boolean canCreateNode(View containerView, int nodeVisualID) {
		String containerModelID = GM.diagram.part.GMVisualIDRegistry
				.getModelID(containerView);
		if (!GoalDiagramEditPart.MODEL_ID.equals(containerModelID)) {
			return false;
		}
		int containerVisualID;
		if (GoalDiagramEditPart.MODEL_ID.equals(containerModelID)) {
			containerVisualID = GM.diagram.part.GMVisualIDRegistry
					.getVisualID(containerView);
		} else {
			if (containerView instanceof Diagram) {
				containerVisualID = GoalDiagramEditPart.VISUAL_ID;
			} else {
				return false;
			}
		}
		switch (containerVisualID) {
		case GoalDiagramEditPart.VISUAL_ID:
			if (GoalEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (AdGoalEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OperationEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EntityEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EventEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (ActionEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (AgentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (RefinementLinkEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case GoalEditPart.VISUAL_ID:
			if (GoalNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (GoalLtlCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case AdGoalEditPart.VISUAL_ID:
			if (AdGoalNamePriorityEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (AdGoalTriggerAdGoalCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (AdGoalConditionAdGoalCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case OperationEditPart.VISUAL_ID:
			if (OperationNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OperationDompostCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OperationDompreCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OperationReqpostCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OperationReqpreCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (OperationTrigpreCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EntityEditPart.VISUAL_ID:
			if (EntityNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EntityStateCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EntityAttributeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EntityRefCompartEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EventEditPart.VISUAL_ID:
			if (EventNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EventAttrEntityCompartEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (EventParamCompartsEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ActionEditPart.VISUAL_ID:
			if (ActionActionTypeEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case AgentEditPart.VISUAL_ID:
			if (AgentNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case RefinementLinkEditPart.VISUAL_ID:
			if (RefinementLinkTypeEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionEditPart.VISUAL_ID:
			if (DefinitionDefEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartmentEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case MappingEditPart.VISUAL_ID:
			if (MappingNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition2EditPart.VISUAL_ID:
			if (DefinitionDef2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping2EditPart.VISUAL_ID:
			if (MappingName2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition3EditPart.VISUAL_ID:
			if (DefinitionDef3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping3EditPart.VISUAL_ID:
			if (MappingName3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition4EditPart.VISUAL_ID:
			if (DefinitionDef4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping4EditPart.VISUAL_ID:
			if (MappingName4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition5EditPart.VISUAL_ID:
			if (DefinitionDef5EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment5EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping5EditPart.VISUAL_ID:
			if (MappingName5EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition6EditPart.VISUAL_ID:
			if (DefinitionDef6EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment6EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping6EditPart.VISUAL_ID:
			if (MappingName6EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition7EditPart.VISUAL_ID:
			if (DefinitionDef7EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment7EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping7EditPart.VISUAL_ID:
			if (MappingName7EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Definition8EditPart.VISUAL_ID:
			if (DefinitionDef8EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			if (DefinitionMappingCompartment8EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Mapping8EditPart.VISUAL_ID:
			if (MappingName8EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case AttributeEditPart.VISUAL_ID:
			if (AttributeMultiplicityNameTypeEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ReferenceEditPart.VISUAL_ID:
			if (ReferenceMultiplicityNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case StateEditPart.VISUAL_ID:
			if (StateNameEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Attribute2EditPart.VISUAL_ID:
			if (AttributeMultiplicityNameType2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case Reference2EditPart.VISUAL_ID:
			if (ReferenceMultiplicityName2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case GoalLtlCompartmentEditPart.VISUAL_ID:
			if (DefinitionEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartmentEditPart.VISUAL_ID:
			if (MappingEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case AdGoalTriggerAdGoalCompartmentEditPart.VISUAL_ID:
			if (Definition3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case AdGoalConditionAdGoalCompartmentEditPart.VISUAL_ID:
			if (Definition2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment3EditPart.VISUAL_ID:
			if (Mapping2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment4EditPart.VISUAL_ID:
			if (Mapping3EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case OperationDompostCompartmentEditPart.VISUAL_ID:
			if (Definition4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case OperationDompreCompartmentEditPart.VISUAL_ID:
			if (Definition5EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case OperationReqpostCompartmentEditPart.VISUAL_ID:
			if (Definition8EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case OperationReqpreCompartmentEditPart.VISUAL_ID:
			if (Definition6EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case OperationTrigpreCompartmentEditPart.VISUAL_ID:
			if (Definition7EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment2EditPart.VISUAL_ID:
			if (Mapping4EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment5EditPart.VISUAL_ID:
			if (Mapping5EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment6EditPart.VISUAL_ID:
			if (Mapping6EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment7EditPart.VISUAL_ID:
			if (Mapping7EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case DefinitionMappingCompartment8EditPart.VISUAL_ID:
			if (Mapping8EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EntityStateCompartmentEditPart.VISUAL_ID:
			if (StateEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EntityAttributeCompartmentEditPart.VISUAL_ID:
			if (AttributeEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EntityRefCompartEditPart.VISUAL_ID:
			if (ReferenceEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EventAttrEntityCompartEditPart.VISUAL_ID:
			if (Attribute2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case EventParamCompartsEditPart.VISUAL_ID:
			if (Reference2EditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		case ContributionLinkEditPart.VISUAL_ID:
			if (ContributionLinkWeightEditPart.VISUAL_ID == nodeVisualID) {
				return true;
			}
			break;
		}
		return false;
	}

	/**
	 * @generated
	 */
	public static int getLinkWithClassVisualID(EObject domainElement) {
		if (domainElement == null) {
			return -1;
		}
		if (GMPackage.eINSTANCE.getContributionLink().isSuperTypeOf(
				domainElement.eClass())) {
			return ContributionLinkEditPart.VISUAL_ID;
		}
		return -1;
	}

	/**
	 * User can change implementation of this method to handle some specific
	 * situations not covered by default logic.
	 * 
	 * @generated
	 */
	private static boolean isDiagram(GoalDiagram element) {
		return true;
	}

}
